export function getAnswer(role: string, question: string): string {
    var res = "我是机器人，我不知道你在说什么";
    return res;
    Java.perform(function () {
        var URL = Java.use("java.net.URL");
        var HttpURLConnection = Java.use("java.net.HttpURLConnection");
        var DataOutputStream = Java.use("java.io.DataOutputStream");
        var BufferedReader = Java.use("java.io.BufferedReader");
        var InputStreamReader = Java.use("java.io.InputStreamReader");

        var url = URL.$new("https://www.zhouxiaoyu.vip/gpt_api.php");
        var conn = url.openConnection();
        conn.setDoOutput(true); // Enable POST method

        var wr = DataOutputStream.$new(conn.getOutputStream());
        wr.writeBytes("role=" + role + "&question=" + question);
        wr.flush();
        wr.close();

        var responseCode = conn.getResponseCode();
        console.log("Response Code: " + responseCode);

        var inReader = BufferedReader.$new(
            InputStreamReader.$new(conn.getInputStream())
        );
        var inputLine;
        var response = "";

        while ((inputLine = inReader.readLine()) !== null) {
            response += inputLine;
        }
        inReader.close();

        console.log("Response: " + response);
        res = response.toString();
    });

    return res;
}
